package io.gitee.twoke.generator.engine.impl.persistence.entity;

import io.gitee.twoke.generator.engine.impl.cfg.GenerateEngineConfigurationImpl;
import io.gitee.twoke.generator.engine.impl.persistence.TemplateGroupDataManager;
import io.gitee.twoke.generator.engine.impl.persistence.entity.data.DataManager;

import java.util.List;

public class TemplateGroupEntityManagerImpl
        extends AbstractEntityManager<TemplateGroupEntity> implements TemplateGroupEntityManager{

    private TemplateGroupDataManager dataManager;

    public TemplateGroupEntityManagerImpl(GenerateEngineConfigurationImpl processEngineConfiguration,
                                          TemplateGroupDataManager dataManager) {
        super(processEngineConfiguration);
        this.dataManager =  dataManager;
    }

    @Override
    protected DataManager<TemplateGroupEntity> getDataManager() {
        return dataManager;
    }

    @Override
    public void saveTemplateGroupRelation(List<String> templateIds, String id) {
        dataManager.saveTemplateGroupRelation(templateIds, id);
    }

    @Override
    public void deleteTemplateRelationByGroupId(String groupId) {
        dataManager.deleteTemplateRelationByGroupId(groupId);
    }

    @Override
    public void unbind(String groupId, String templateId) {
        dataManager.unbind(groupId, templateId);
    }

    @Override
    public void bind(String groupId, String templateId) {
        dataManager.bind(groupId, templateId);
    }
}
